namespace graver.CodeAnalysis.Syntax;

/// <summary>
/// 字面量表达式
/// </summary>
public sealed class LiteralExpressionSyntax : ExpressionSyntax
{
    public LiteralExpressionSyntax(SyntaxToken literalToken) : this(literalToken, literalToken.Value)
    {
        LiteralToken = literalToken;
    }

    public LiteralExpressionSyntax(SyntaxToken literalToken, object literalValue)
    {
        LiteralToken = literalToken;
        LiteralValue = literalValue;
    }

    public SyntaxToken LiteralToken { get; }
    public object LiteralValue { get; }

    public override SyntaxKind Kind => SyntaxKind.LiteralExpression;

    public override IEnumerable<SyntaxNode> GetChildren()
    {
        yield return LiteralToken;
    }
}
